// 云函数入口文件
/*在详情页点击添加的判断，判断是加个商品还是加数量 */
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database()
const _ = db.command

// 云函数入口函数
exports.main = async (event, context) => {
  var uid = event.uid
  var id = event.id
  return await db.collection("cart").where({
    uid: uid,
    pids: {
      id: id
    }
  }).get()
  
}